home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 146
/
(Vol 146) Jan 07 2012.iso
/
Games
/
the_great_candy_caper.swf
/
scripts
/
frame_3
/
DoAction.as
Wrap
Text File
|
2012-01-07
|
1KB
|
62 lines
function spawnBot(randNum, mcRef)
{
var randNum;
var mcRef;
if(mcRef == "spider")
{
var i = 0;
while(i < randNum)
{
attachMovie("spd_bot","spd_bot" + spidDepth,500 + spidDepth);
tmpMc = _root["spd_bot" + spidDepth];
tmpMc._y = - tmpMc._height;
i++;
}
spidDepth++;
}
if(mcRef == "bat")
{
var j = 0;
while(j < randNum)
{
attachMovie("bat_bot","bat_bot" + j,1000 + j);
j++;
}
}
if(mcRef == "candy")
{
var k = 1;
while(k < randNum)
{
attachMovie("candy","candy" + candyDepth,2000 + candyDepth);
tmpMc = _root["candy" + candyDepth];
tmpMc.gotoAndStop(randGen(4,1,true));
candyDepth++;
k++;
}
}
}
function randGen(range, flrVal, integer)
{
var range;
var flrVal;
var randNum;
var integer;
if(integer)
{
randNum = Math.floor(Math.random() * range + flrVal);
}
else
{
randNum = Math.random() * range + flrVal;
}
return randNum;
}
var score = 30;
var distance = 0;
var spidDepth = 1;
var time = 0;
var spidDepth;
var candyDepth = 10;
stop();